﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Web-Forms/Master.master" AutoEventWireup="true"
    CodeBehind="Register.aspx.cs" Inherits="aspnetprovider.Web_Forms.Register" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="BodyContent" runat="server">
    <div id="createUserControl">
        <div class="form-cols">
            <div class="form-row">
                <div class="form-label">
                    <asp:Label AssociatedControlID="FirstName" CssClass="labels" ID="FristNameLabel"
                        runat="server" Text="First Name:"></asp:Label>
                </div>
                <div class="form-control">
                    <asp:TextBox ID="FirstName" CssClass="text-box" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="FirstNameRequried" runat="server" ControlToValidate="FirstName"
                        CssClass="form-validator" ErrorMessage="*" ForeColor="Red" ToolTip="FirstName is required."
                        ValidationGroup="CreateUserWizard1" Display="Static">*</asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="form-row">
                <div class="form-label">
                    <asp:Label AssociatedControlID="MiddleName" CssClass="labels" ID="MiddleNameLabel"
                        runat="server" Text="Middle Name:"></asp:Label>
                </div>
                <div class="form-control">
                    <asp:TextBox ID="MiddleName" CssClass="text-box" runat="server"></asp:TextBox>
                </div>
            </div>
            <div class="form-row">
                <div class="form-label">
                    <asp:Label AssociatedControlID="LastName" CssClass="labels" ID="LastNameLabel" runat="server"
                        Text="Last Name:"></asp:Label>
                </div>
                <div class="form-control">
                    <asp:TextBox ID="LastName" CssClass="text-box" runat="server"></asp:TextBox>
                </div>
            </div>
        </div>
        <div class="form-cols">
            <div class="form-row">
                <div class="form-label">
                    <asp:Label AssociatedControlID="Gender" CssClass="labels" ID="GenderLabel" runat="server"
                        Text="Gender:"></asp:Label>
                </div>
                <div class="form-control">
                    <div class="radioBtn" style="margin-right: 10px;">
                        <asp:RadioButtonList ID="Gender" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow"
                            CssClass="radio-button">
                            <asp:ListItem Value="M" Text="Male"></asp:ListItem>
                            <asp:ListItem Value="F" Text="Female"></asp:ListItem>
                        </asp:RadioButtonList>
                        <asp:RequiredFieldValidator ID="GenderRequried" runat="server" ControlToValidate="Gender"
                            Display="Static" CssClass="form-validator" ErrorMessage="*" ForeColor="Red" ValidationGroup="CreateUserWizard1"
                            ToolTip="Gender is required.">*</asp:RequiredFieldValidator>
                    </div>
                </div>
            </div> 
            <div class="form-row">
                <div class="form-label">
                    <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label>
                </div>
                <div class="form-control">
                    <asp:TextBox ID="Email" runat="server" CssClass="text-box"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
                        CssClass="form-validator" ForeColor="Red" ErrorMessage="*" ToolTip="E-mail is required."
                        ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                     <div><asp:RegularExpressionValidator CssClass="form-validator" ControlToValidate="Email" ValidationExpression="^\w+(.\w+)?@\w+.\w+(.\w+)?$"
                            ValidationGroup="CreateUserWizard1" ID="EmailRegular" runat="server" Display="Dynamic"
                            ErrorMessage="Invalid Email..!"></asp:RegularExpressionValidator></div>
                </div>
            </div>
            <div class="form-row">
                <div class="form-label">
                    <asp:Label ID="AlterEmailLabel" runat="server" AssociatedControlID="AlterEmail">Alternate E-mail:</asp:Label>
                </div>
                <div class="form-control">
                    <asp:TextBox ID="AlterEmail" runat="server" CssClass="text-box"></asp:TextBox>
                    <div><asp:RegularExpressionValidator CssClass="form-validator" ControlToValidate="AlterEmail" ValidationExpression="^\w+(.\w+)?@\w+.\w+(.\w+)?$"
                            ValidationGroup="CreateUserWizard1" ID="AlterEmailRegular" runat="server"  Display="Dynamic"
                            ErrorMessage="Invalid Email..!"></asp:RegularExpressionValidator></div>
                </div>
            </div>
        </div>
        <div class="form-cols">
            <div class="form-row">
                <div class="form-label">
                    <asp:Label ID="BusinessPhoneLabel" runat="server" AssociatedControlID="BusinessPhone">Business Phone:</asp:Label>
                </div>
                <div class="form-control">
                    <asp:TextBox ID="BusinessPhone" runat="server" MaxLength="15" CssClass="text-box"></asp:TextBox>
                    <div>
                        <asp:RegularExpressionValidator CssClass="form-validator" ControlToValidate="BusinessPhone" ValidationExpression="^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$"
                            ValidationGroup="CreateUserWizard1" ID="BusinessPhoneRegular" runat="server"
                            ErrorMessage="Invalid PhoneNo/Format..!"></asp:RegularExpressionValidator></div>
                </div>
            </div>
            <div class="form-row">
                <div class="form-label">
                    <asp:Label ID="MobilePhoneLabel" runat="server" AssociatedControlID="MobilePhone">Mobile Phone:</asp:Label>
                </div>
                <div class="form-control">
                    <asp:TextBox ID="MobilePhone" runat="server" MaxLength="15" CssClass="text-box"></asp:TextBox>
                    <div>
                        <asp:RegularExpressionValidator CssClass="form-validator" ControlToValidate="MobilePhone" ValidationExpression="^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$"
                            ValidationGroup="CreateUserWizard1" ID="MobilePhoneRegular" runat="server" ErrorMessage="Invalid PhoneNo/Format..!"></asp:RegularExpressionValidator></div>
                </div>
            </div>
        </div>
        <div class="form-cols">
            <div class="form-row">
                <div class="form-label">
                    <asp:Label AssociatedControlID="UserName" CssClass="labels" ID="UserNameLabel" runat="server"
                        Text="Username:"></asp:Label>
                </div>
                <div class="form-control">
                    <asp:TextBox ID="UserName" CssClass="text-box" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                        ValidationGroup="CreateUserWizard1" CssClass="form-validator" ErrorMessage="*"
                        ForeColor="Red" ToolTip="Username is required." Display="Static">*</asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="form-row">
                <div class="form-label">
                    <asp:Label AssociatedControlID="Password" CssClass="labels" ID="PasswordLabel" runat="server"
                        Text="Password:"></asp:Label>
                </div>
                <div class="form-control">
                    <asp:TextBox ID="Password" CssClass="text-box" runat="server" TextMode="Password"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                        ValidationGroup="CreateUserWizard1" CssClass="form-validator" ErrorMessage="*"
                        ForeColor="Red" ToolTip="Password is required." Display="Static">*</asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="form-row">
                <div class="form-label">
                    <asp:Label AssociatedControlID="ConfirmPassword" CssClass="labels" ID="ConfirmPasswordLabel"
                        runat="server" Text="ConfirmPassword:"></asp:Label>
                </div>
                <div class="form-control">
                    <asp:TextBox ID="ConfirmPassword" CssClass="text-box" runat="server" TextMode="Password"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword"
                        CssClass="form-validator" ErrorMessage="*" ForeColor="Red" ToolTip="Confirm Password is required."
                        ValidationGroup="CreateUserWizard1" Display="Static">*</asp:RequiredFieldValidator>
                </div>
            </div>
        </div>
        <div class="form-cols">
            <div class="form-row">
                <div class="form-label">
                    <asp:Label AssociatedControlID="Question" CssClass="labels" ID="QuestionLabel" runat="server"
                        Text="Password Question:"></asp:Label>
                </div>
                <div class="form-control">
                    <asp:TextBox ID="Question" CssClass="text-box" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question"
                        CssClass="form-validator" ErrorMessage="*" ForeColor="Red" ToolTip="PasswordQuestion is required."
                        ValidationGroup="CreateUserWizard1" Display="Static">*</asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="form-row">
                <div class="form-label">
                    <asp:Label AssociatedControlID="Answer" CssClass="labels" ID="AnswerLabel" runat="server"
                        Text="Password Answer:"></asp:Label>
                </div>
                <div class="form-control">
                    <asp:TextBox ID="Answer" CssClass="text-box" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer"
                        CssClass="form-validator" ErrorMessage="*" ForeColor="Red" ToolTip="PasswordAnswer is required."
                        ValidationGroup="CreateUserWizard1" Display="Static">*</asp:RequiredFieldValidator>
                </div>
            </div>
        </div>
        <div class="form-row">
            <div class="form-control">
                <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                    CssClass="form-validator" ControlToValidate="ConfirmPassword" Display="Static"
                    ErrorMessage="The Password and Confirmation Password must match." ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
            </div>
        </div>
        <div class="form-row">
            <div class="form-control">
                <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
            </div>
        </div>

        <div class="form-row">
            <div class="form-control">
                <asp:Button ID="CreateUser" CommandName="CreateUser" runat="server" UseSubmitBehavior="true"
                    ValidationGroup="CreateUserWizard1" Text="Register" CssClass="form-button" 
                    onclick="CreateUser_Click" />
            </div>
        </div>
    </div>
</asp:Content>
